package com.ruoyi.consume.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.consume.mapper.GreenhousefilmApplyTemporaryConMapper;
import com.ruoyi.consume.domain.GreenhousefilmApplyTemporaryCon;
import com.ruoyi.consume.service.IGreenhousefilmApplyTemporaryConService;

/**
 * 棚膜临时领用Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-27
 */
@Service
public class GreenhousefilmApplyTemporaryConServiceImpl implements IGreenhousefilmApplyTemporaryConService
{
    @Autowired
    private GreenhousefilmApplyTemporaryConMapper greenhousefilmApplyTemporaryConMapper;

    /**
     * 查询棚膜临时领用
     *
     * @param greenhousefilmApplyTemporaryId 棚膜临时领用ID
     * @return 棚膜临时领用
     */
    @Override
    public GreenhousefilmApplyTemporaryCon selectGreenhousefilmApplyTemporaryById(Long greenhousefilmApplyTemporaryId)
    {
        return greenhousefilmApplyTemporaryConMapper.selectGreenhousefilmApplyTemporaryById(greenhousefilmApplyTemporaryId);
    }

    /**
     * 查询棚膜临时领用列表
     *
     * @param greenhousefilmApplyTemporaryCon 棚膜临时领用
     * @return 棚膜临时领用
     */
    @Override
    public List<GreenhousefilmApplyTemporaryCon> selectGreenhousefilmApplyTemporaryList(GreenhousefilmApplyTemporaryCon greenhousefilmApplyTemporaryCon)
    {
        return greenhousefilmApplyTemporaryConMapper.selectGreenhousefilmApplyTemporaryList(greenhousefilmApplyTemporaryCon);
    }

    /**
     * 新增棚膜临时领用
     *
     * @param greenhousefilmApplyTemporaryCon 棚膜临时领用
     * @return 结果
     */
    @Override
    public int insertGreenhousefilmApplyTemporary(GreenhousefilmApplyTemporaryCon greenhousefilmApplyTemporaryCon)
    {
        greenhousefilmApplyTemporaryCon.setCreateTime(DateUtils.getNowDate());
        return greenhousefilmApplyTemporaryConMapper.insertGreenhousefilmApplyTemporary(greenhousefilmApplyTemporaryCon);
    }

    /**
     * 修改棚膜临时领用
     *
     * @param greenhousefilmApplyTemporaryCon 棚膜临时领用
     * @return 结果
     */
    @Override
    public int updateGreenhousefilmApplyTemporary(GreenhousefilmApplyTemporaryCon greenhousefilmApplyTemporaryCon)
    {
        greenhousefilmApplyTemporaryCon.setUpdateTime(DateUtils.getNowDate());
        return greenhousefilmApplyTemporaryConMapper.updateGreenhousefilmApplyTemporary(greenhousefilmApplyTemporaryCon);
    }

    /**
     * 批量删除棚膜临时领用
     *
     * @param greenhousefilmApplyTemporaryIds 需要删除的棚膜临时领用ID
     * @return 结果
     */
    @Override
    public int deleteGreenhousefilmApplyTemporaryByIds(Long[] greenhousefilmApplyTemporaryIds)
    {
        return greenhousefilmApplyTemporaryConMapper.deleteGreenhousefilmApplyTemporaryByIds(greenhousefilmApplyTemporaryIds);
    }

    /**
     * 删除棚膜临时领用信息
     *
     * @param greenhousefilmApplyTemporaryId 棚膜临时领用ID
     * @return 结果
     */
    @Override
    public int deleteGreenhousefilmApplyTemporaryById(Long greenhousefilmApplyTemporaryId)
    {
        return greenhousefilmApplyTemporaryConMapper.deleteGreenhousefilmApplyTemporaryById(greenhousefilmApplyTemporaryId);
    }

    /**
     * 更新库存量表
     *
     * @param greenhousefilmApplyTemporaryCon 棚膜临时领用
     * @return 结果
     */
    @Override
    public int updateAmount(GreenhousefilmApplyTemporaryCon greenhousefilmApplyTemporaryCon){
        return greenhousefilmApplyTemporaryConMapper.updateAmount(greenhousefilmApplyTemporaryCon);
    }

    /**
     * 更新领用状态
     *
     * @param greenhousefilmApplyTemporaryId 棚膜临时领用ID
     * @return 结果
     */
    @Override
    public int updateConsumeStatus(Long greenhousefilmApplyTemporaryId){
        return greenhousefilmApplyTemporaryConMapper.updateConsumeStatus(greenhousefilmApplyTemporaryId);
    }

    /**
     * 退回操作
     *
     * @param greenhousefilmApplyTemporaryId 棚膜临时领用ID
     * @return 结果
     */
    @Override
    public int updateApprovalStatus(Long greenhousefilmApplyTemporaryId){
        return greenhousefilmApplyTemporaryConMapper.updateApprovalStatus(greenhousefilmApplyTemporaryId);
    }
}
